package com.agileai.pm.module.base.handler;

import java.util.List;

import com.agileai.domain.DataParam;
import com.agileai.domain.DataRow;
import com.agileai.hotweb.controller.core.StandardListHandler;
import com.agileai.hotweb.renders.LocalRenderer;
import com.agileai.hotweb.renders.ViewRenderer;
import com.agileai.pm.module.base.service.ProjectDocumentManage;

public class ProjectDocumentManageListHandler
        extends StandardListHandler {
    public ProjectDocumentManageListHandler() {
        super();
        this.editHandlerClazz = ProjectDocumentManageEditHandler.class;
        this.serviceId = buildServiceId(ProjectDocumentManage.class);
    }

    protected void processPageAttributes(DataParam param) {
    }

    public ViewRenderer prepareDisplay(DataParam param){
		mergeParam(param);
		initParameters(param);
		this.setAttributes(param);
		List<DataRow> rsList = getService().findRecords(param);
		this.setRsList(rsList);
		processPageAttributes(param);
		return new LocalRenderer(getPage());
	}
    protected void initParameters(DataParam param) {
        initParamItem(param, "PD_NAME", "");
    }

    protected ProjectDocumentManage getService() {
        return (ProjectDocumentManage) this.lookupService(this.getServiceId());
    }
}
